import cv2
cap = cv2.VideoCapture("http://192.168.43.15")
if not cap.isOpened():
    print("Failed to open stream")
else:
    print("Stream opened successfully")
cap.release()